package com.xiangxiao.rpan.data.exception;

import com.xiangxiao.rpan.data.constant.ResponseCode;

/**
 * @Projectname: rpan-data
 * @Author: xiangxiao
 * @Email: 573768011@qq.com
 * @Data:2024/5/31 1:55
 */
public class DataException extends RuntimeException {
  /**
   * 错误信息
   */
  private final String msg;

  /**
   * 错误码
   */
  private int errorCode = ResponseCode.FAIL;

  public DataException(String msg) {
    super(msg);
    this.msg = msg;
  }

  public DataException(String msg, int errorCode) {
    super(msg);
    this.msg = msg;
    this.errorCode = errorCode;
  }


  @Override
  public String getMessage() {
    return msg;
  }

  public int getErrorCode() {
    return errorCode;
  }
}
